Skip to content

chore: replace num_cpus with available_parallelism #2946

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

tisonkun
Copy link
Contributor

@tisonkun tisonkun commented Apr 8, 2025

Related discussion: tokio-rs/tokio#6211 and tokio-rs/tokio#6709

cc @taiki-e

@rustbot rustbot added A-executor Area: futures::executor S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 8, 2025
@tisonkun
Copy link
Contributor Author

tisonkun commented Apr 8, 2025

https://github.com/rust-lang/futures-rs/actions/runs/14322140475/job/40140977417

Failed to compile iovec 0.1.0 - doesn't seem to be related. It should be resolved to 0.1.4 and previously runs all passed. This patch doesn't touch it.

@taiki-e
Copy link
Member

taiki-e commented Apr 16, 2025

iovec crate is used by old dependencies that are enabled via the compat/compat-io feature, but given that our traits are planned to remain basically unchanged between futures 0.3 and 0.4, it is not a problem to remove compat and compat-io features in 0.4. (From a maintenance standpoint, their removal is also welcome because they were not easy to maintain (e.g., #2514).)

@taiki-e taiki-e removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 16, 2025
@tisonkun
Copy link
Contributor Author

Thanks for your information! Seems I can take a look at dropping dependency to iovec in another PR. For this one, we'd on hold until then or I can rebase on master and ping you once CI is happy.

@tisonkun tisonkun force-pushed the replace-numcpu-with-available_parallelism branch from 0be4cdd to 9bc953e Compare April 24, 2025 09:42
@tisonkun
Copy link
Contributor Author

Seems libc's version causes this issue.

Previously, we have:

  Adding libc v0.2.26 (available: v0.2.172)

Now, it becomes:

  Adding libc v0.2.0 (available: v0.2.172)

Maybe num_cpus add a requirement to help indicates the version. I'll try to add a specific libc version and see.

@tisonkun
Copy link
Contributor Author

tisonkun commented May 19, 2025

For iovec itself, it's depends on tokio's code path (also mio and bytes), it should deserve a new patch to investigate.

@rustbot rustbot added A-lock Area: futures::lock A-stream Area: futures::stream labels May 19, 2025
@tisonkun
Copy link
Contributor Author

@taiki-e This patch should be ready for merge now.

The clippy related changes are attached because we have a clippy CI check that runs on latest compiler. I suppose it's intended.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-executor Area: futures::executor A-lock Area: futures::lock A-stream Area: futures::stream
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants